﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace ITJZ.BitHelper.Tools
{
    public class HttpHelper
    {
        public static string UploadString(string address,string data)
        {
            WebClient client = new WebClient();
            client.Encoding = System.Text.Encoding.UTF8;
            client.Headers.Add(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
            string reply = client.UploadString(address, data);
            return reply;
        }

        public static string GetString(string address)
        {
            WebClient client = new WebClient();
            client.Encoding = System.Text.Encoding.UTF8;
            string reply = client.DownloadString(address);
            return reply;
        }
    }
}
